import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '房产编号',
    align: "center",
    dataIndex: 'propertyNumber'
  },
  {
    title: '用户号',
    align: "center",
    dataIndex: 'userId'
  },
  {
    title: '业主姓名',
    align: "center",
    dataIndex: 'ownerName'
  },
  {
    title: '购买数量',
    align: "center",
    dataIndex: 'purchaseQuantity'
  },
  {
    title: '购买金额',
    align: "center",
    dataIndex: 'purchasAmount'
  },
  {
    title: '缴费方式',
    align: "center",
    dataIndex: 'paymentMethod'
  },
  {
    title: '销售日期',
    align: "center",
    dataIndex: 'saleDate'
  },
  {
    title: '创建方式',
    align: "center",
    dataIndex: 'createType'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "社区名称",
    field: 'communityName',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "房产编号",
    field: 'propertyNumber',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "用户号",
    field: 'userId',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "销售日期",
    field: 'saleDate',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '社区名称',
    field: 'communityName',
    component: 'Input',
  },
  {
    label: '房产编号',
    field: 'propertyNumber',
    component: 'Input',
  },
  {
    label: '用户号',
    field: 'userId',
    component: 'Input',
  },
  {
    label: '业主姓名',
    field: 'ownerName',
    component: 'Input',
  },
  {
    label: '购买数量',
    field: 'purchaseQuantity',
    component: 'InputNumber',
  },
  {
    label: '购买金额',
    field: 'purchasAmount',
    component: 'InputNumber',
  },
  {
    label: '缴费方式',
    field: 'paymentMethod',
    component: 'Input',
  },
  {
    label: '销售日期',
    field: 'saleDate',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss'
    },
  },
  {
    label: '创建方式',
    field: 'createType',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  propertyNumber: {title: '房产编号',order: 1,view: 'text', type: 'string',},
  userId: {title: '用户号',order: 2,view: 'text', type: 'string',},
  ownerName: {title: '业主姓名',order: 3,view: 'text', type: 'string',},
  purchaseQuantity: {title: '购买数量',order: 4,view: 'number', type: 'number',},
  purchasAmount: {title: '购买金额',order: 5,view: 'number', type: 'number',},
  paymentMethod: {title: '缴费方式',order: 6,view: 'text', type: 'string',},
  saleDate: {title: '销售日期',order: 7,view: 'datetime', type: 'string',},
  createType: {title: '创建方式',order: 8,view: 'text', type: 'string',},
};
